package service;

public class UserEvent extends Event {

	protected String userName;
	
	public UserEvent(String type, String userName) {
		super(type);
		this.userName=userName;
	}
	
	public String getUserName() {
		return this.userName;
	}
	
	public String toString() {
		String string = this.type+": "+dateFormat.format(this.timestamp) + " - user "+this.userName;
		if(this.type.equals("USER_LOGIN")) string += " logged in";
		if(this.type.equals("USER_LOGOUT")) string += " logged out";
		if(this.type.equals("USER_DISCONNECTED")) string += " disconnected";

		
		return string;
	}
	
}
